package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.internetofthings.autonet;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.autonet.AutoNetService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 自动联网监测控制器
 */
@Action
@RequestMapping(value="autoNet/autoNet")
public class AutoNetController extends BaseController {
    @Resource
    public AutoNetService autoNetService;

    /**
     * 首页数据
     * @param
     * @return
     */
    @At(value = "getHomePageData", method = RequestMethod.GET, param = { "nums","type","userType"})
    public RespEntity getHomePageData(@RequestBody(required = false) JSONObject jsonParam) {
        return autoNetService.getHomePageData(jsonParam);
    }

    /**
     * 实时报警列表
     * @param
     * alarmType	报警类型
     * @return
     */
    @At(value = "realTimeAlarm", method = RequestMethod.GET)
    public RespEntity realTimeAlarm(@RequestBody(required = false) JSONObject jsonParam) {
        return autoNetService.realTimeAlarm(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description type	1 一周  2  本月	是	说明一下：以下是用type==1举例的；当type==2时，需要返回整个自然的月的数据
     * @Date Created in 14:31 2022/6/17
     * @Param [jsonParam]
     */

    @At(value = "weekAlarm", method = RequestMethod.GET)
    public RespEntity weekAlarm(@RequestBody(required = false) JSONObject jsonParam) {
        return autoNetService.weekAlarm(jsonParam);
    }


}
